package com.ym.soso.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


@EnumDescription("收费档次")
public enum ChargeLevelEnum implements DictEnum {

    //--------------------start-----------------


    FIRST("01", "1000-以下"),
    SECOND("02", "1000-3000"),
    THIRD("03", "3000-5000"),
    FOURTH("04", "5000-7000"),
    FIFTH("05", "7000-9000"),
    SIXTH("06", "10000-以上"),
    //--------------------end-------------------
    ;

    private String key;

    private String value;

    ChargeLevelEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(ChargeLevelEnum.class, value);
        }
    }
}
